import time
from selenium import webdriver
from selenium.webdriver.common.by import By
class Test_By_Css():
    def setup(self):
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()
    def test_by_css(self):
        self.driver.get('https://www.baidu.com')
        self.driver.find_element(By.ID,'kw').send_keys('hello')
        self.driver.find_element(By.ID,'su').click()
        time.sleep(3)
        self.driver.find_element(By.CSS_SELECTOR,'#s_tab a:nth-child(3)').click()

    def teardown(self):
        self.driver.quit()

